﻿using Castle.DynamicProxy;
using System;

namespace Utility
{
    //引入库 做动态代理 Castle.Core
    public class InterceptAOP : IInterceptor
    {
        public void Intercept(IInvocation invocation)
        {
            Before();
            invocation.Proceed();
            After();
        }
        public virtual void Before()
        {
            Console.WriteLine("Castle.Core拦截前");
        }
        public virtual void After()
        { 
            Console.WriteLine("Castle.Core拦截后");
        }
    }
}
